/*
 * Copyright 2010-2012 Susanta Tewari. <freecode4susant@users.sourceforge.net>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/*
* ComJLHoodOModel.java
*
* Created on December 29, 2007, 10:39 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
 */
package gui.genomemap.outputModel;

import gui.genomemap.outputModel.options.ComJLHoodOOptionsModel;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToOne;

/**
 *
 * @author stewari1
 */
@Entity
public class ComJLHoodOModel extends OutputModel implements java.io.Serializable {

    /** Field description */
    public static final int FIG_IPMAP = 0;

    /** Field description */
    public static final int FIG_IGMAP = 1;

    /** Field description */
    public static final int FIG_IFULLMAP = 2;

    /** Field description */
    private double lHood = 0.0;

    /** Field description */
    private String iterationLog = "";

    /** Field description */
    private int[] geneOrder = null;

    /** Field description */
    private double pLogLikeliHood = 0.0;

    /** Field description */
    private double gLogLikeliHood = 0.0;

    /** Field description */
    private double[] probeSpacing = null;

    /** Field description */
    @OneToOne(cascade = CascadeType.ALL)
    private ComJLHoodOOptionsModel optionsModel = new ComJLHoodOOptionsModel();

    /** Creates a new instance of ComJLHoodOModel */
    public ComJLHoodOModel() {}

    public int hashCode() {
        return super.hashCode() + new Double(getLHood()).hashCode();
    }

    public boolean equals(Object obj) {

        if (obj instanceof ComJLHoodOModel) {

            ComJLHoodOModel comJLHoodOModel = (ComJLHoodOModel) obj;

            return super.equals(comJLHoodOModel) && (getLHood() == comJLHoodOModel.getLHood());
        }

        return false;
    }

    public double getLHood() {
        return lHood;
    }

    public void setLHood(double lHood) {
        this.lHood = lHood;
    }

    public String getIterationLog() {
        return iterationLog;
    }

    public void setIterationLog(String iterationLog) {
        this.iterationLog = iterationLog;
    }

    public ComJLHoodOOptionsModel getOptionsModel() {
        return optionsModel;
    }

    public void setOptionsModel(ComJLHoodOOptionsModel optionsModel) {
        this.optionsModel = optionsModel;
    }

    public int[] getGeneOrder() {
        return geneOrder;
    }

    public void setGeneOrder(int[] geneOrder) {
        this.geneOrder = geneOrder;
    }

    public double getPLogLikeliHood() {
        return pLogLikeliHood;
    }

    public void setPLogLikeliHood(double pLogLikeliHood) {
        this.pLogLikeliHood = pLogLikeliHood;
    }

    public double getGLogLikeliHood() {
        return gLogLikeliHood;
    }

    public void setGLogLikeliHood(double gLogLikeliHood) {
        this.gLogLikeliHood = gLogLikeliHood;
    }

    public double[] getProbeSpacing() {
        return probeSpacing;
    }

    public void setProbeSpacing(double[] probeSpacing) {
        this.probeSpacing = probeSpacing;
    }
}
